<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<%@ page import="org.apache.struts.taglib.html.Constants" %>
<%@ page import="org.apache.struts.Globals" %>
<%@page import="live.cz.entity.Order"%>
<%@page import="live.common.Format"%>
<%@page import="live.cz.dao.OrderPay"%>
<%@page import="live.common.PostParam"%>
<%@page import="live.pay.SignUtil"%>
<%@page import="live.api.impl.PaySendReqRes"%>
<%@page import="live.common.GetSequence"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
Order order = (Order)request.getAttribute("item");
OrderPay op = new OrderPay();	
String req_trans_tm=Format.getInstance().dateFormatString(new Date(), "yyyyMMddHHmmss");
String req_trans_seq=GetSequence.returnSeqNum();
String amt = String.valueOf((int)(order.getSalePrice()*100));
String desc=op.returnOrderDesc(order);
Map map = new TreeMap();
map.put("service_id","110003");
map.put("req_org_cd","123456");
map.put("req_trans_tm",req_trans_tm);
map.put("req_trans_seq",req_trans_seq);
map.put("order_id",order.getOrderid());
map.put("seller_id","12345");
map.put("sub_order_flag","N");
map.put("sub_order_num","0");
map.put("order_desc",desc);
map.put("tot_trans_amt",amt);
map.put("buyer_id","12345678");
map.put("valid_date","0");
map.put("notify_url",PostParam.NOTIFY.toString());
map.put("return_url","");
String sign=SignUtil.sign(map,PostParam.PAYKEY.toString());
map.put("sign",sign);
map.put("sign_type","MD5");
PaySendReqRes.insertSendRequest(map);
%>
<jsp:include page="../pub_head.jsp">
<jsp:param value="4" name="type"/>
</jsp:include>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <base href="<%=basePath %>">
    <title>手机充值</title>
    <META content="text/html; charset=UTF-8" http-equiv="Content-Type">
<META http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
	<script type="text/javascript" src="script/jquery-1.3.1.js"></script>
	<LINK  media="all" href="css/global.css" type="text/css" rel="stylesheet"/>
	<LINK media="all" href="css/tickets.css" type="text/css" rel="stylesheet"/>
	<link rel="stylesheet" type="text/css" href="hfcz/css/charging.css" />
	<script type="text/javascript" src="script/zDialog.js"></script>
	<script type="text/javascript" src="script/zDrag.js"></script>
<style> 
.rbox-bg{background: url("hfcz/css/bg-form-middle.jpg") repeat-y; width: 750px;}
.rbox-top{background: url("hfcz/css/bg-form-top.jpg") no-repeat left top; width: 750px;}
.rbox-bottom{background: url("hfcz/css/bg-form-bottom.jpg") no-repeat left bottom;padding:20px 18px 20px;zoom: 1; width: 750px;}
.rbox-border{border: 1px solid #5d8eaf; width: 712px;}
</style>
  </head>
  
  <body>
   <div class="wrapper clearfix">
   <div class="stepout shouji">
   <H1>手机话费充值</H1>

    <ul>

      <li class="current">填写充值信息</li>

      <li class="current">支付</li>

      <li>完成</li>

    </ul>
  </div>
  <div>
<div class="rbox"> 
<div class="rbox-bg">
<div class="rbox-top">
<div class="rbox-bottom">
<div class="rbox-border"> 
<div class="telephone tel-form">
<%--<input type="hidden" name="<%=Constants.TOKEN_KEY%>"    value="<%=session.getAttribute(Globals.TRANSACTION_TOKEN_KEY)%>"/>--%> 
 <div class="tel-section tel-num">
<label class="tel-section-title" for="J_TelInput">手机号：</label>
<div class="tel-section-field">
					<div class="tel-num-wrapper" id="J_TelInputBox">
                       <b>${hfitem.phonenum }</b>
					</div>
				</div>
</div>
<div class="tel-section tel-num">
<label class="tel-section-title" for="J_TelInput">充值面额：</label>
<div class="tel-section-field">
					<div class="tel-num-wrapper" id="J_TelInputBox">
                       <b>￥<fmt:formatNumber value="${hfitem.proPrice}" pattern="#"></fmt:formatNumber>元</b>
					</div>
				</div>
</div>
<div class="tel-section tel-num">
<label class="tel-section-title" for="J_TelInput">支付金额：</label>
<div class="tel-section-field">
					<div class="tel-num-wrapper" id="J_TelInputBox">
                       <b style="color: red">￥<fmt:formatNumber value="${hfitem.salePrice}" pattern="#.##"></fmt:formatNumber>元</b>
					</div>
				</div>
</div>
<div class="tel-buy with-ad" id="J_TelBuyPanel">
	<button class="tel-submit" id="J_TelSubmitBtn" onclick="doSubmit()" hidefocus="true">立即支付</button>
	<br/>
</div>
<form action="<%=PostParam.PAY_API.toString() %>" method="post" target="_blank">
    	<input name="service_id" value="110003"/>
    	<input name="req_org_cd" value="123456"/>
    	<input name="req_trans_tm" value="<%=req_trans_tm %>"/>
    	<input name="req_trans_seq" value="<%=req_trans_seq%>"/>
    	<input name="order_id" value="<%=order.getOrderid() %>"/>
    	<input name="seller_id" value="12345"/>
    	<input name="sub_order_flag" value="N"/>
    	<input name="sub_order_num" value="0"/>
    	<%-- <input name="sub_order_dtl" value=""/>--%>
    	<input name="order_desc" value="<%=desc%>"/>
    	<input name="tot_trans_amt" value="<%=amt%>"/>
    	<input name="buyer_id" value="12345678"/>
    	<input name="valid_date" value="0"/>
    	<input name="notify_url" value="<%=PostParam.NOTIFY.toString() %>"/>
    	<input name="return_url" value=""/>
    	<input name="sign" value="<%=sign %>"/>
    	<input name="sign_type" value="MD5"/>
    </form>
</div>
</div></div></div></div> 
</div></div>
<div id="mask"></div>
<div class="alertDiv" style="display:none" id="payResultDiv">
  <%-- <div class="mask_block" id="payResultMaskDiv"></div> 
  <div class="alertbox alertpay" style="display:block"> 
    <div class="close"><a href="#" onclick="mask.hide('payResultDiv')">close</a><span>帐户充值提示</span></div> 
    <div class="pack"><p>请根据您的付款情况选择</p></div> 
    <div class="btn"><input type="button" value="已完成付款" class="orangebtn_l" onclick="payResultMsg('1')" /> <input type="button" value="付款遇到问题" class="orangebtn_l" onclick="payResultMsg('2')" /></div> 
  </div>--%> 
</div>  
<script type="text/javascript" src="/script/pop.js"></script>
<script type="text/javascript">
<!--
	function doSubmit(){
		//$('form:first').submit();
		//alert("支付网关暂不开放，请进行其他操作……");
//return false;
	}
//-->
</script>
 <%@include file="../footer.jsp" %>
</div>
  </body>
</html>
